package com.designpattern.creating.abstractfactory;

import com.designpattern.creating.factory.Factory;
import lombok.extern.slf4j.Slf4j;

/**
 * @author chengze
 * @date 2022/11/22
 * @desc 抽象工厂，工厂的工厂
 */
@Slf4j
public class AbstractFactory {

    public static FactoryInterFace getFactory(int factoryType){
        switch (factoryType){
            case  1 : {
                log.info("选择产线1");
                return new Factory();
            }
            case  2: {
                log.info("选择产线2");
                return new Factory2();
            }
            default:
                log.info("没有匹配的产线类型！");
                return null;
        }
    }
}
